package com.scorpio.goods.mapper;

import com.scorpio.common.dao.BaseDao;
import com.scorpio.goods.domain.GoodsSpecEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品规格属性Mapper接口
 *
 * @author scorpio
 * @date 2021-11-01
 */
@Mapper
public interface GoodsSpecMapper extends BaseDao<GoodsSpecEntity> {

    GoodsSpecEntity selectByNumber(@Param("number") String number);

    List<GoodsSpecEntity> selectByNumbers(@Param("numbers") String[] numbers);

    int updateSpecNumber(@Param("id") Long id, @Param("number") String number);

    int couneSpecByGoods(@Param("goodsId") Long goodsId);

    int countByNumber(@Param("number") String number);

    int adminUpdate(GoodsSpecEntity entity);

    int updateDelete(@Param("ids") Long[] ids);

    int updateInventory(
            @Param("id") Long id
            , @Param("change") Integer change
            , @Param("soldoutTotal") Integer soldoutTotal
    );

}
